<?php

require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration {
    static protected $zendLoaded = false;

    static public function registerZend() {
        if (self::$zendLoaded) {
            return;
        }

        set_include_path(sfConfig::get('sf_lib_dir').'/vendor'.PATH_SEPARATOR.sfConfig::get('sf_lib_dir').'/vendor/Zend/library'.PATH_SEPARATOR.get_include_path());
        require_once sfConfig::get('sf_lib_dir').'/vendor/Zend/library/Zend/Loader/Autoloader.php';
        Zend_Loader_AutoLoader::getInstance();
        self::$zendLoaded = true;
    }

    /**
     * This function is automatically called by the doctrine plugin's loading
     * sequence
     *
     * @param Doctrine_Manager $manager Doctrine configuration manager
     */
    public function configureDoctrine(Doctrine_Manager $manager) {
        /**
         * Globally set the DQL Callbacks setting on - so as to permit
         * the SoftDelete behaviour to be used (may also come in handy later
         * if the Versional behaviour is required)
         */
        /**
         * SoftDelete behaviour disabled since it doesn't have the desired
         * effect ( we stil want to access deleted collections directly
         * but don't want them to be availble for new relations etc)
         */
       // $manager->setAttribute(Doctrine_Core::ATTR_USE_DQL_CALLBACKS, true);
    }

    public function setup() {
        $this->enablePlugins('sfDoctrinePlugin');
        $this->enablePlugins('sfDoctrineGuardPlugin');
        $this->enablePlugins('trDistributionConfigurePlugin');
        $this->enablePlugins('sfFormExtraPlugin');
    }
}

